/*
 *       $$
 *
 *     Copyright (C) 1999 - 2001, Daniel Potts, University of New South Wales.
 *
 *     Copyright (C) 1995, 1996, Sebastian Schoenberg, University of
 *     Technology Dresden, Department of Computer Science.
 *
 *     This file is part of the L4/Alpha micro-kernel distribution.
 *
 *     This program is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License
 *     as published by the Free Software Foundation; either version 2
 *     of the License, or (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program; if not, write to the Free Software
 *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */
/*
 * Proportions of this file are taken from L4/MIPS dit.h. L4 on Alpha
 * attempts to make use of the same structures to make programming
 * easier.
 */

#ifndef DITE_H
#define DITE_H

#define DITE_RUN         0x01
#define DITE_MANAGER     0x02

#define DITE_NIDENT      4
#define DITE_NPNAME      16

typedef unsigned int Dite_uint;

struct Dite_Dhdr {
    char d_ident[DITE_NIDENT];
    Dite_uint d_phoff;
    Dite_uint d_phsize;
    Dite_uint d_phnum;
    Dite_uint d_fileend;
    Dite_uint d_vaddrend;
};             /* DITE Header */

struct Dite_Phdr {
    Dite_uint p_base;
    Dite_uint p_size;
    Dite_uint p_entry;
    Dite_uint p_flags;
    char p_name[DITE_NPNAME];
    /* These are added at the end to be backwards
       compatible  */
    Dite_uint p_magic;
    Dite_uint p_phys_base;
};             /* DITE File entry */

struct Dite_Phdr * dite_getentry(struct Dite_Dhdr *dite_hdr, int pos);
struct Dite_Phdr * dite_lookup(struct Dite_Dhdr *dite_hdr, char *name);
struct Dite_Dhdr * dite_gethdr(void);

struct elf_test {
    Dite_uint	type;			// 0x02
    Dite_uint	version;		// 1
    Dite_uint	offset_next;

    Dite_uint	text_pstart;
    Dite_uint	text_vstart;
    Dite_uint	text_size;
    Dite_uint	data_pstart;
    Dite_uint	data_vstart;
    Dite_uint	data_size;
    Dite_uint	bss_pstart;
    Dite_uint	bss_vstart;
    Dite_uint	bss_size;
    Dite_uint	initial_ip;
    Dite_uint	flags;
    Dite_uint	label;
    Dite_uint	cmdline_offset;
};


#endif
